Skip to content

fix: apply import map during GitHub branch Edge Function bundling#5653

Closed
Tanusree-samanta wants to merge 1 commit into
supabase:developfrom
Tanusree-samanta:fix/github-branch-import-map-resolution
Closed

fix: apply import map during GitHub branch Edge Function bundling#5653
Tanusree-samanta wants to merge 1 commit into
supabase:developfrom
Tanusree-samanta:fix/github-branch-import-map-resolution

Conversation

@Tanusree-samanta

Copy link
Copy Markdown

Closes supabase/supabase#47000

What changed

  • ShouldUseDenoJsonDiscovery now checks that the import map file
    actually exists before skipping the --import-map flag
  • Added test coverage for missing file, existing file, and non-deno
    import map cases

Why

The GitHub branch deploy pipeline runs in a different working
directory than local supabase functions deploy, so Deno's
auto-discovery of deno.json silently failed, breaking @backend/
style path aliases. This mirrors the explicit resolution already
used locally.

How to test

  • Deploy an Edge Function with path aliases via GitHub branching
  • Verify @backend/ aliases resolve correctly

Fixes #47000

ShouldUseDenoJsonDiscovery skipped passing --import-map when the
import map sat next to the entrypoint, assuming Deno would auto-
discover it. This works locally but fails in GitHub branch deploy
pipelines where the working directory differs, breaking @backend/
style path aliases. Now we verify the file actually exists before
relying on auto-discovery.
@Tanusree-samanta Tanusree-samanta requested a review from a team as a code owner June 22, 2026 17:50
@Tanusree-samanta

Copy link
Copy Markdown
Author

I've opened a PR that addresses this: [link to your PR]

Root cause: ShouldUseDenoJsonDiscovery in pkg/function/bundle.go
assumed Deno would auto-discover deno.json whenever it sat in the
same directory as the entrypoint, so it skipped passing --import-map
explicitly. That assumption holds for local supabase functions deploy,
but breaks in the GitHub branch deploy pipeline where the working
directory differs, causing @backend/ style path aliases

@jgoux

jgoux commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution. 🙏

This issue has to be handled in our branching service codebase rather than in the CLI.
I opened a PR in our branching service in order to address it.

@jgoux jgoux closed this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deploying functions from a branch tracked by the Github fail on path resolution

2 participants